package cn.com.dhcc.app.pub.core.job;

import java.io.FileNotFoundException;
import java.io.IOException;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import cn.com.dhcc.app.core.exception.JmxException;
import cn.com.dhcc.app.core.exception.ServiceException;
import cn.com.dhcc.app.core.service.Log;
import cn.com.dhcc.app.core.service.Log.LOGTYPE;
import cn.com.dhcc.app.pub.CM;
import cn.com.dhcc.ddi.monitor.service.MonitorService;

public class CheckBasicInfoJob implements Job{
	private static Logger logger = Log.getLogger(LOGTYPE.DDI);
	
	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		MonitorService monitorService = CM.getBean(MonitorService.class);
	
		try {
			monitorService.checkBasicInfo();
		} catch (FileNotFoundException e) {
			logger.error("系统基本信息收集异常",e);
		} catch (ServiceException e) {
			logger.error("系统基本信息收集异常",e);
		} catch (IOException e) {
			logger.error("计算cpu使用率错误",e);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			logger.error("计算cpu使用率错误",e);
		} catch (NumberFormatException e) {
			logger.error("计算cpu使用率错误",e);
		} catch (JmxException e) {
			logger.error("系统基本信息收集异常",e);
		}
		
		
	}
}
